#include <stdio.h>
#include <math.h>
int main()
{
	int n, i, j, zz, fac_zheng;
	double fac = 0, fac_xiao;
	scanf("%d", &n);
	for(i = 0; i < n; i++)
	{
		fac = 0;
		scanf("%d", &zz);
		for(j = 2; j <= zz; j++)
		{
			fac += log10(j);
		}
		fac_zheng = int(fac);
		fac_xiao = fac - fac_zheng;
		printf("%d\n", fac_zheng);
		printf("%lf\n", fac);
		printf("%.4lfe+%d\n", pow(10, fac_xiao), fac_zheng);
	}
	return 0;
}
